package com.d3works.exception;

import com.d3works.rpc.ActionResponse;
import java.util.function.BiConsumer;

public enum ResponseMessageType {
  INFORMATION(ActionResponse::setInfo),
  WARNING(ActionResponse::setAlert),
  ERROR(ActionResponse::setError),
  NOTIFICATION(ActionResponse::setNotify);

  private BiConsumer<ActionResponse, String> messageMethod;

  ResponseMessageType(BiConsumer<ActionResponse, String> messageMethod) {
    this.messageMethod = messageMethod;
  }

  public void setMessage(ActionResponse response, String message) {
    messageMethod.accept(response, message);
  }
}
